<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - Bootstrap Table</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="/admin/favicon.ico"> <link href="/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/admin/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/admin/css/animate.css" rel="stylesheet">
    <link href="/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <script src="/admin/js/jquery.min.js?v=2.1.4"></script>
    <style>
        a{
            color:#777;
        }
    </style>

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox-content">
            <div class="row row-lg">
            <div class="col-sm-12">
                <!-- Example Events -->
                <div class="example-wrap">
                    <div class="example">
                        <div class="btn-group hidden-xs" id="tabtar" role="group">

                        </div>
                        <table id="table" data-toggle='table' data-height="400">
                            <thead>
                                <tr>
                                    <th data-field="state" data-checkbox="true"></th>
                                    <th data-sortable='true'>ID</th>
                                    <th>用户</th>
                                    <th>商品</th>
                                    <th>评论级别</th>
                                    <th>评论内容</th>
                                    <th>评论时间</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach($arr as $list)
                                <tr>
                                    <td></td>
                                    <td>{{$list->id}}</td>
                                    <td>{{$list->username}}</td>
                                    <td>{{$list->name}}</td>
                                    <td>{{$list->opinion}}</td>
                                    <td>
                                        <a href="javascript:;" onclick='cCon({{$list->id}})'>点击查看</a>
                                    </td>
                                    <td>{{$list->ctime}}</td>
                                    <td>
                                        @if($list->state==0)
                                        <a class="btn btn-default">未回复</a>
                                        @else
                                        <a class="btn btn-primary">已回复</a>
                                        @endif
                                    </td>
                                    <td>
                                        @if($list->state==0)
                                        <a href="javascript:;" onclick="reply({{$list->id}})" class='btn btn-info'>回复</a>
                                        @else
                                        <a href="javascript:;" onclick="reply_show(this)" class='btn btn-info'>查看回复</a>
                                        <div class="hidden">{{$list->reply}}</div>
                                        @endif
                                    </td>
                                </tr>
                                @endforeach

                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- End Example Events -->
            </div>
            </div>
        </div>
    </div>

    <!-- 全局js -->
    <script src="/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/admin/js/layer.js"></script>

    <!-- 自定义js -->
    <script src="/admin/js/content.js?v=1.0.0"></script>


    <!-- Bootstrap table -->
    <script src="/admin/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/admin/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="/admin/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <!-- Peity -->
    <script src="/admin/js/demo/bootstrap-table-demo.js"></script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码，可删除-->
    <script>
        // 评论内容
        function cCon(id){
            layer.open({
                type:2,
                title:false,
                shadeClose:true,
                scrollbar:false,
                area:['850px','200px'],
                content:'/admin/goodscomment/goodscomment_details?id='+id,
            })
        }
        // 回复评论
        function reply(id){
            layer.prompt({
                formtype:2,
                value:'',
                title:'回复评论',
                area:['500px','200px'],
            },function(value,index){
                $.post('/admin/goodscomment/goodscomment_reply',{'id':id,'reply':value},function(data){
                    // alert(data);
                    layer.msg('回复成功',{icon:1});
                    layer.close(index);
                    window.location.reload();
                })
            })
        }
        // 查看回复
        function reply_show(thiss){
            layer.alert($(thiss).next().html());
        }
    </script>

    <script>
        $('#table').bootstrapTable({
            search:true,
            showRefresh:true,
            showColumns:true,
            showToggle:true,
            pagination:true,
            pageSize:'5',
            iconSize:'outline',
            toolbar: '#tabtar',
        });


    </script>
</body>
</html>
